package org.scut.gis.spider.data.entity;

import com.google.common.collect.Maps;
import lombok.Data;

import java.util.Map;

/**
 * 任务
 * @author pi.siyuan
 */
@Data
public class Task {

    /**
     * 请求url
     */
    private String url;

    /**
     * 请求方法
     */
    private String method;

    /**
     * HTTP Header
     */
    private Map<String, String> headers;

    /**
     * cookies
     */
    private Map<String, String> cookies;

    /**
     * user agent
     */
    private String userAgent;

    /**
     * 任务上下文
     */
    private Map<String, Object> context;


    public Task() {
        this.headers = Maps.newHashMapWithExpectedSize(16);
        System.out.println(headers.size());
    }



    public void setHeader(String header, String value) {
        this.headers.put(header, value);
    }

}
